package com.qiwenshare.ufop.provider.util;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import com.qiwenshare.ufop.provider.config.AliyunConfig;

/**
 * Aliyun Utils
 */
public class AliyunUtils {

    private AliyunUtils() {
        throw new UnsupportedOperationException("Cannot instantiate utility class");
    }

    public static OSS getOSSClient(AliyunConfig aliyunConfig) {

        return new OSSClientBuilder().build(
                aliyunConfig.getOss().getEndpoint(),
                aliyunConfig.getOss().getAccessKeyId(),
                aliyunConfig.getOss().getAccessKeySecret());
    }
}
